import Vue from 'vue'
import Router from 'vue-router'
import Home from "../views/home/Home";
import Category from "../views/category/Category";
import Shopcart from "../views/shopcart/Shopcart";
import Profile from "../views/profile/Profile";

Vue.use(Router)

const originalpush = Router.prototype.push
Router.prototype.push = function (location) {
  return originalpush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '',
      component: Home
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/category',
      component: Category
    },
    {
      path: '/shopcart',
      component: Shopcart
    },
    {
      path: '/profile',
      component: Profile
    }
  ]
})
